from flask_script import Manager  # 配合数据库迁移进行使用
from flask_migrate import Migrate, MigrateCommand  # 数据库迁移步奏
from info import create_app, db
import logging
from info import models


app = create_app('development')

# 创建manger对象,数据库迁移需要配合这里才能使用
manager = Manager(app)
Migrate(app, db)

# 添加执行命令
manager.add_command('db', MigrateCommand)
# #
# # 以下为日志输出打印,根据app = create_app('development')调用函数得到的不同级别进行打印
# logging.log(logging.DEBUG, "This is a debug log.")                  # 调试模式
# logging.log(logging.INFO, "This is a info log.")                    # 一般信息
# logging.log(logging.WARNING, "This is a warning log.")              # 警告
# logging.log(logging.ERROR, "This is a error log.")                  # 错误
# logging.log(logging.CRITICAL, "This is a critical log.")            # 毁灭性级别


if __name__ == '__main__':
    # app.run(host='0.0.0.0')
    manager.run()

"""
(py3_flask) python@ubuntu:~/PycharmProjects/InfoMation$ git init
初始化空的 Git 仓库于 /home/python/PycharmProjects/InfoMation/.git/
(py3_flask) python@ubuntu:~/PycharmProjects/InfoMation$ ls -al
ls-al 下面有一个gitignore专门用来管理忽略文件
"""
